<?xml version="1.0"?>
<!--
  ~ Copyright 2004-2012 ICEsoft Technologies Canada Corp.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the
  ~ License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an "AS
  ~ IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  ~ express or implied. See the License for the specific language
  ~ governing permissions and limitations under the License.
  -->

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:c="http://java.sun.com/jsp/jstl/core" 
    xmlns:ace="http://www.icefaces.org/icefaces/components" 
    xmlns:ice="http://www.icesoft.com/icefaces/component" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    template="/resources/templates/content-template.xhtml">
    
    <ui:param name="title" value="#{msgs[collapsible.title]}"/>
    <ui:param name="description" value="#{msgs[collapsible.description]}"/>
    <ui:param name="resourceValue" value="#{collapsible.exampleResource}"/>
    
    <ui:param name="wikiResources" value="#{compatComponentsResources.wikiResources}"/>
    <ui:param name="tldResources" value="#{compatComponentsResources.tldResources}"/>
    
    <ui:define name="example">
        <h:form>
            <ice:panelCollapsible expanded="#{collapsibleExpanded.expanded}">
                <f:facet name="header">
                    <h:panelGrid columns="2">
                        <h:graphicImage value="/resources/css/images/collapsible-on.gif" alt="Collapse"/>
                        <h:outputText value="ICEfaces Ajax Push" styleClass="panelHeaderStyle"/>
                    </h:panelGrid>
                </f:facet>
                
                <b>Definition</b>
                <p>Ajax Push allows the application to incrementally update any part of the page at any time, for any group of clients. This is a small change in terms of the technical capabilities of Ajax applications, but it is a revolutionary change in terms of what applications can actually provide to users. Ajax Push is the key to building collaborative multi-user applications for the web.</p>
                
                <b>Programming Model</b>
                
                <p>Ajax Push can be added to an application with just two lines of code.</p>
                <p>The org.icefaces.application.PushRenderer pushes page updates to groups of pages. To cause all pages in "someGroup" to be updated with the current server state, call:</p>
                <pre>PushRenderer.render("someGroup");</pre>
                <p>The easiest way to assemble push groups is to push updates to all pages in a user's session using:</p>
                <pre>PushRenderer.addCurrentSession("someGroup");</pre>
                <p>To distinguish between individual pages in a session, use:</p>
                <pre>PushRenderer.addCurrentView("someGroup");</pre>
                
                <p>It really is as simple as that to add real-time collaboration to your JSF application.</p>
                
            </ice:panelCollapsible>
        </h:form>
    </ui:define>
</ui:composition>
